home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / libs / mlib / include / marray.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-02-26  |  2.2 KB  |  67 lines

  1.  
  2. #ifndef __MARRAY_H
  3. #define __MARRAY_H
  4.  
  5. #define MINLEN               0      // Minimum array size
  6. #define MARGIN               1      // Extra bytes to allocate
  7.  
  8. #define BARRAY_ID            0x0103
  9. #define CARRAY_ID            0x0104
  10. #define WARRAY_ID            0x0105
  11.  
  12. ////////////////////////////// Bitmap class //////////////////////////////////
  13.  
  14. class bArray : public Atom {
  15.     WORD                     length;
  16.     WORD                     width;
  17. public:
  18.                  bArray (void);
  19.                  bArray (WORD len, WORD wid = 1);
  20.                  bArray (const bArray& arr);
  21.     virtual BOOL             operator[] (WORD index);
  22.     virtual BOOL             Read (WORD x, WORD y);
  23.     virtual inline classType isA (void) {return (BARRAY_ID);};
  24.     virtual void             Activate (WORD index);
  25.     virtual void             Activate (WORD x, WORD y);
  26.     virtual void             Activate (const RECT& area);
  27.     virtual void             Deactivate (WORD index);
  28.     virtual void             Deactivate (WORD x, WORD y);
  29.     virtual void             Deactivate (const RECT& area);
  30.     virtual void             Resize (SIZE n_Size);
  31.                 ~bArray (void);
  32. };
  33. typedef bArray BARRAY;
  34.  
  35. ///////////////////////// Character and word arrays //////////////////////////
  36.  
  37. class cArray : public Atom {
  38. public:
  39.                  cArray (void);
  40.                  cArray (SIZE size);
  41.                  cArray (WORD len, BYTE *arr);
  42.                  cArray (const cArray& arr);
  43.     virtual inline classType isA (void) {return (CARRAY_ID);};
  44.     virtual BYTE&            operator[] (WORD index);
  45.     operator                 BYTE*() const;
  46.     friend cArray            operator+ (const cArray& a1, const cArray& a2);
  47.     virtual cArray&          operator= (BYTE * string);
  48.                 ~cArray (void);
  49. };
  50. typedef cArray CARRAY;
  51.  
  52. class wArray : public Atom {
  53. public:
  54.                  wArray (void);
  55.                  wArray (SIZE size);
  56.                  wArray (WORD len, WORD *arr);
  57.                  wArray (const wArray& arr);
  58.     virtual inline classType isA (void) {return (WARRAY_ID);};
  59.     virtual WORD&            operator[] (WORD index);
  60.     virtual operator         WORD*() const;
  61.     friend wArray            operator+ (const wArray& a1, const wArray& a2);
  62.                            ~wArray (void);
  63. };
  64. typedef wArray WARRAY;
  65.  
  66. #endif
  67.